package abc.lb;

import com.alibaba.nacos.api.naming.pojo.Instance;
import lombok.Data;
import org.springframework.cloud.client.DefaultServiceInstance;
import org.springframework.cloud.client.ServiceInstance;

import java.net.URI;

@Data
public class AbcServiceInstance extends Instance implements ServiceInstance {
    @Override
    public String getServiceId() {
        return super.getServiceName();
    }

    @Override
    public String getHost() {
        return super.getIp();
    }

    @Override
    public int getPort() {
        return super.getPort();
    }

    @Override
    public boolean isSecure() {
        return false;
    }

    @Override
    public URI getUri() {
        return DefaultServiceInstance.getUri(this);
    }
}
